import {CONTENT_LIST} from './actionType.js'
import {CHANGEREADYSTATE} from 'component/ScrollView/scrollViewActionsTypes.js'

import axios from 'axios'

export const getContentListData = (page) => (dispatch) => {
  dispatch({
    type: CHANGEREADYSTATE,
    obj: false
  })
  axios({
      method: 'get',
      url: '/json/homelist.json'
    }).then(res => {
      window.setTimeout(() => {
        dispatch({
          type: CONTENT_LIST,
          currentPage: page,
          obj: res.data
        })
        dispatch({
          type: CHANGEREADYSTATE,
          obj: true
        })
      })
    })
}